factory method design pattern in .net c